{% extends "./inc/base.html" %}
{% block content %}
<section class="vbox">

    <header class="header bg-light dk">
        <ul class="nav nav-tabs pull-left">
            <li class="{% if ctx.action == 'index'%}active{%endif%}" ><a href="/{{ctx.controller}}/index"><i class="fa fa-user text-muted"></i> 会员组 </a></li>
            <li class="{% if ctx.action == 'admin'%}active{%endif%}" ><a href="/{{ctx.controller}}/admin"><i class="fa fa-user text-muted"></i> 管理员角色</a></li>
        </ul>
    </header>
    <section class="scrollable wrapper">

        <section class="panel panel-default">
            <header class="panel-heading">
               {{controller.meta_title}}
                <i data-title="只有新增了字段，数据库表才会真正建立" data-placement="bottom" data-toggle="tooltip" class="fa fa-info-sign text-muted" data-original-title="" title=""><i class="fa fa-question-circle"></i></i>
            </header>
            <div class="row wrapper">

                <div class="col-sm-9 m-b-xs">
                    <div class="">
                        <a class="btn btn-sm btn-info " href="/{{ctx.controller}}/adduser">
                            添加会员组
                        </a>
                        <a class="btn btn-sm btn-info ajax-post confirm"  href="/{{ctx.controller}}/deluser" target-form="ids">
                            删除
                        </a>
                        <a class="btn btn-sm btn-info ajax-post" target-form="sort" href="/{{ctx.controller}}/sort/?type=1">
                            排序
                        </a>
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="input-group pull-right">
                        <input type="text" class="input-sm form-control" placeholder="Search">
                        <span class="input-group-btn">
                        <button class="btn btn-sm btn-default" type="button">Go!</button>
                      </span>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped b-t b-light">
                    <thead>
                    <tr>
                        <th style="width:20px;"><label class="checkbox m-n i-checks"><input type="checkbox"><i></i></label></th>
                        <th style="width:50px;">ID</th>
                        <th style="width:80px;">排序</th>
                        <th class="">用户组名</th>
                        <th class="">系统组	</th>
                        <th class="">会员数</th>
                        <th>星星数</th>
                        <th>积分小于</th>
                        <th>允许上传附件</th>
                        <th>投稿权限</th>
                        <th>投稿不需审核</th>
                        <th>搜索权限</th>
                        <th class="">发短消息</th>
                        <th >操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for item in list %}
                    <tr>
                        <td>{%if item.issystem !=1%}<label class="checkbox m-n i-checks"><input class="ids" type="checkbox" name="ids" value="{{item.groupid}}" ><i></i></label>{%endif%}</td>
                        <td>{{item.groupid}}</td>
                        <td><input class="form-control form-control-text sort" value="{{item.sort}}" name="sort" data-id="{{item.groupid}}"/></td>
                        <td>{{item.name}}</td>

                        <td>{%if item.issystem ==1%}<i class="fa fa-check text-success"></i>{%else%}<i class="fa fa-times text-danger"></i>{%endif%}</td>
                        <td>{{item.count}}</td>
                        <td>
                            {{item.starnum}}
                        </td>
                        <td>
                            {{item.point}}
                        </td>
                        <td>
                            {%if item.allowattachment ==1%}<i class="fa fa-check text-success"></i>{%else%}<i class="fa fa-times text-danger"></i>{%endif%}
                        </td>
                        <td>
                            {%if item.allowpost ==1%}<i class="fa fa-check text-success"></i>{%else%}<i class="fa fa-times text-danger"></i>{%endif%}
                        </td>
                        <td>
                            {%if item.allowpostverify ==1%}<i class="fa fa-check text-success"></i>{%else%}<i class="fa fa-times text-danger"></i>{%endif%}
                        </td>
                        <td>
                            {%if item.allowsearch ==1%}<i class="fa fa-check text-success"></i>{%else%}<i class="fa fa-times text-danger"></i>{%endif%}
                        </td>
                        <td>
                            {%if item.allowsendmessage ==1%}<i class="fa fa-check text-success"></i>{%else%}<i class="fa fa-times text-danger"></i>{%endif%}
                        </td>
                        <td>
                            <a href="/admin/auth/edituser?id={{item.groupid}}" class="text-info">编辑</a>
                            {%if item.issystem !=1%}
                            <a href="/admin/auth/deluser?id={{item.groupid}}" class="confirm ajax-get text-info">删除</a></td>
                            {%endif%}
                    </tr>
                    {% else %}
                    <tr><td colspan="14"><div class="alert alert-warning alert-block">
                        <button data-dismiss="alert" class="close" type="button">×</button>
                        <p>This would display if the 'item' collection were empty</p>
                    </div></td></tr>

                    {% endfor %}


                    </tbody>
                </table>
            </div>
            <footer class="panel-footer">
                <div class="row">


                    <div class="col-sm-12 text-right text-center-xs">
                        {{pagerData | safe}}
                    </div>
                </div>
            </footer>
        </section>
    </section>
</section>

{% endblock %}